<include file="Public:header" />
<!--LOGO图片设置-->
<div class="subnav">
    <h1 class="title_2 line_x">网站LOGO设置</h1>
</div>
<div class="pad_lr_10">
	<form id="info_form" action="{:U('Setting/logo')}" method="post" enctype="multipart/form-data">
	<table width="100%" class="table_form">
        <tr>
            <th style="width: 150px;">首页LOGO :<br>w:200px * h:70px</th>
            <td>
                <php>if($info['logo']){</php>
                <div style="margin: 10px;">
                    <a href="{$info.logo}" target="_blank"><img style="height: 70px;" src="{$info.logo}"></a>
                </div>
                <php>}</php>
               <input type="text" name="logo[logo]" value="{$info.logo}" id="J_img_logo" class="input-text fl mr10" size="50">
                <div id="J_upload_img_logo" onclick="UpImg('logo')" class="upload_btn"><span>{:L('upload')}</span></div>
            </td>
        </tr>
        <tr>
            <th>地图搜索页面LOGO :<br>w:200px * h:60px</th>
            <td>
                <php>if($info['map']){</php>
                <div style="margin: 10px;">
                    <a href="{$info.map}" target="_blank"><img style="height: 60px;" src="{$info.map}"></a>
                </div>
                <php>}</php>
                <input type="text" name="logo[map]" value="{$info.map}" id="J_img_map" class="input-text fl mr10" size="50">
                <div id="J_upload_img_map" onclick="UpImg('map')" class="upload_btn"><span>{:L('upload')}</span></div>
            </td>
        </tr>
        <tr>
            <th>登录/注册页面LOGO :<br>w:200px * h:70px</th>
            <td>
                <php>if($info['login']){</php>
                <div style="margin: 10px;">
                    <a href="{$info.login}" target="_blank"><img style="height: 70px;" src="{$info.login}"></a>
                </div>
                <php>}</php>
                <input type="text" name="logo[login]" value="{$info.login}" id="J_img_login" class="input-text fl mr10" size="50">
                <div id="J_upload_img_login" onclick="UpImg('login')" class="upload_btn"><span>{:L('upload')}</span></div>
            </td>
        </tr>
        <tr>
            <th>会员中心LOGO :<br>w:236px * h:50px</th>
            <td>
                <php>if($info['user']){</php>
                <div style="margin: 10px;">
                    <a href="{$info.user}" target="_blank"><img style="width: 236px;height: 50px;" src="{$info.user}"></a>
                </div>
                <php>}</php>
                <input type="text" name="logo[user]" value="{$info.user}" id="J_img_user" class="input-text fl mr10" size="50">
                <div id="J_upload_img_user" onclick="UpImg('user')" class="upload_btn"><span>{:L('upload')}</span></div>
            </td>
        </tr>
        <tr>
            <th>手机版LOGO :<br>w:170px * h:50px</th>
            <td>
                <php>if($info['wap']){</php>
                <div style="margin: 10px;">
                    <a href="{$info.wap}" target="_blank"><img style="width: 170px;height: 50px;background: orange" src="{$info.wap}"></a>
                </div>
                <php>}</php>
                <input type="text" name="logo[wap]" value="{$info.wap}" id="J_img_wap" class="input-text fl mr10" size="50">
                <div id="J_upload_img_wap" onclick="UpImg('wap')" class="upload_btn"><span>{:L('upload')}</span></div>
            </td>
        </tr>
        <tr>
        	<th></th>
        	<td>
                <br>
                <input type="hidden" name="menuid"  value="{$menuid}"/>
                <input type="submit" class="btn btn_submit" value="{:L('submit')}"/>
                <br><br><br>
            </td>
    	</tr>
	</table>
	</form>
</div>
<include file="Public:footer" />
<script src="__JS__/fileuploader.js"></script>
<script>
    $(function(){

    });

    function UpImg(v){
        var str_id = "J_upload_img_"+v;
        //上传图片
        var img_uploader = new qq.FileUploaderBasic({
            allowedExtensions: ['jpg','gif','jpeg','png','bmp','pdg'],
            button: document.getElementById(str_id),
            multiple: false,
            action: "{:U('Setting/ajax_upload_img')}",
            inputName: 'img',
            forceMultipart: true, //用$_FILES
            messages: {
                typeError: lang.upload_type_error,
                sizeError: lang.upload_size_error,
                minSizeError: lang.upload_minsize_error,
                emptyError: lang.upload_empty_error,
                noFilesError: lang.upload_nofile_error,
                onLeave: lang.upload_onLeave
            },
            showMessage: function(message){
                $.pinphp.tip({content:message, icon:'error'});
            },
            onSubmit: function(id, fileName){
                $('#'+ str_id).addClass('btn_disabled').find('span').text(lang.uploading);
            },
            onComplete: function(id, fileName, result){
                $('#'+ str_id).removeClass('btn_disabled').find('span').text(lang.upload);
                if(result.status == '1'){
                    $('#J_img_'+v).val(result.data);
                } else {
                    $.pinphp.tip({content:result.msg, icon:'error'});
                }
            }
        });
    }

</script>
</body>
</html>